package jfuzzyprincepless.zarchive.algorithm.structure.forcnstr.fuzzyfor;

import java.util.ArrayList;
import java.util.List;

import jfuzzyprincepless.agents.INegotiatingAgent;
import jfuzzyprincepless.zarchive.algorithm.structure.ICommandConstruction;
import jfuzzyprincepless.zarchive.algorithm.structure.forcnstr.BaseNegotiationFor;
import jfuzzyprincepless.zarchive.variables.FuzzySet;
import jfuzzyprincepless.zarchive.variables.IFuzzySet;

public class NegotiationFuzzyFor<E>
	extends BaseNegotiationFor<E>
	implements INegotiationFuzzyFor<E>
{
	private IFuzzySet<E> fuzzyForSet;

	public NegotiationFuzzyFor(
		IFuzzySet<E> fuzzyForSet,
		ICommandConstruction[] forBodyCommands,
		List<INegotiatingAgent> agents
	) {
		super(forBodyCommands, agents);
		this.fuzzyForSet = fuzzyForSet;
	}

	public NegotiationFuzzyFor(
		IFuzzySet<E> fuzzyForSet,
		ICommandConstruction... forBodyCommands
	) {
		this(
			fuzzyForSet,
			forBodyCommands,
			new ArrayList<INegotiatingAgent>()
		);
	}

	public NegotiationFuzzyFor(IFuzzySet<E> fuzzyForSet) {
		this(
			fuzzyForSet,
			ICommandConstruction.EMPTY_ARRAY
		);
	}

	public NegotiationFuzzyFor() {
		this(FuzzySet.<E>emptySet());
	}

	@Override
	public Iterable<E> getIterable() {
		return fuzzyForSet.getElements();
	}

	@Override
	public IFuzzySet<E> getFuzzyForSet() {
		return fuzzyForSet;
	}
}
